Hyperlinks within a table - '<a href="">'.$row['username'].'</a>'
Posted
by
Taimur
on Stack Overflow
See other posts from Stack Overflow
or by Taimur
Published on 2011-01-07T07:48:21Z
Indexed on
2011/01/07
7:54 UTC
Read the original article
Hit count: 196
Hi,
I have made a leaderboard table on my site, which returns the users in the MySQL database with the highest scores (score is a separate field). The fields in the leaderboard table are 'rank' 'username' and 'score'. I would like to link each username in the table to it's own profile page.
The profile pages are in the format /profile.php?user=$username. How would I go about adding an <a href>
within the table (which is echoed in php):
echo '<tr><td>' .$a. '</td><td><a href="profile.php?user=' .$row['username']. '">' .$row['username']. '</a></td><td>'.$row['count'].'</td></tr>';
I've tried the above, but it doesn't seem to work. It shows the usernames, but they don't have any hyperlinks.
Thanks
© Stack Overflow or respective owner